from twisted.internet import selectreactor

selectreactor.install()
from twisted.internet import reactor
from twisted.web import server, resource


class Urls(resource.Resource):
    "Url配置及主项目函数"

    def __init__(self):
        resource.Resource.__init__(self)
        self.putChild("", self)

    def render_GET(self, request):
        return "home page"


reactor.listenTCP(8080, server.Site(Urls()))

import multiprocessing

p = multiprocessing.Process(args=('child-1',))
p.start()
p.join()

reactor.run()
